package com.yuantong.xyerp.rest.config.APIJson;

import apijson.NotNull;
import apijson.RequestMethod;
import apijson.framework.APIJSONObjectParser;
import apijson.orm.Join;
import apijson.orm.SQLConfig;
import com.alibaba.fastjson.JSONObject;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * Created by Jianguo.Yin on 2021-07-13.
 */
public class XyerpObjectParser extends APIJSONObjectParser {
    /**
     * for single object
     *
     * @param session
     * @param request
     * @param parentPath
     * @param arrayConfig
     * @param isSubquery
     * @param isTable
     * @param isArrayMainTable
     * @throws Exception
     */
    public XyerpObjectParser(HttpSession session, @NotNull JSONObject request, String parentPath, SQLConfig arrayConfig, boolean isSubquery, boolean isTable, boolean isArrayMainTable) throws Exception {
        super(session, request, parentPath, arrayConfig, isSubquery, isTable, isArrayMainTable);
    }

    @Override
    public SQLConfig newSQLConfig(RequestMethod method, String table, String alias, JSONObject request, List<Join> joinList, boolean isProcedure) throws Exception {
        return XyerpSQLConfig.newSQLConfig(method, table, alias, request, joinList, isProcedure);
    }
}
